package end.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import end.bean.shiro.Manager;
import end.bean.shiro.Resource;
import end.ser.ManagerSER;
import end.ser.ResourceSER;

/**
 * 
 * TestForController.java 2016-7-14
 * 
 * Copyright zhaocj Inc. All rights reserved. Love Me Like Love Justin Bieber
 */
@Controller
public class TestForController {
	@Autowired
	private ResourceSER<Resource> resourceSER;

	public ResourceSER<Resource> getResourceSER() {
		return resourceSER;
	}

	public void setResourceSER(ResourceSER<Resource> resourceSER) {
		this.resourceSER = resourceSER;
	}

	@Autowired
	private ManagerSER<Manager> managerSER;

	public ManagerSER<Manager> getManagerSER() {
		return managerSER;
	}

	public void setManagerSER(ManagerSER<Manager> managerSER) {
		this.managerSER = managerSER;
	}

	@RequestMapping("/test1")
	public @ResponseBody
	List<Resource> test1() {
		return resourceSER.queryMenuResources();
	}

	@RequestMapping("/test2")
	public @ResponseBody
	Manager test2() throws Exception {
		return managerSER.selectByPrimaryKey("manager5");
	}

	@RequestMapping("/test/download/apk")
	public void test3(HttpServletRequest request, HttpServletResponse response) {
	}
}
